package com.l2jserver.gameserver.network.serverpackets;

/**
 * @author mochitto
 * @update by Fissban
 */
public class ExNevitAdventTimeChange extends L2GameServerPacket
{
	private final boolean _paused;
	private final int _time;
	
	/**
	 * @param time -1 = Paused, 24000 = 4min
	 */
	public ExNevitAdventTimeChange(int time)
	{
		_time = time > 24000 ? 24000 : time;
		_paused = _time < 0;
	}
	
	@Override
	protected void writeImpl()
	{
		writeC(0xFE);
		writeH(0xE1);
		writeC(_paused ? 0x00 : 0x01);
		// left time in ms max is 16000 its 4m and state is automatically changed to quit
		writeD(_time);
	}
}
